<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/react/16.8.4/umd/react.development.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/react-dom/16.8.4/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
  </head>
  <body>
    <div id="test"></div>
    <script type="text/babel">
      // 定义一个Person类
      class Person {
        constructor(name, age) {
          this.name = name;
          this.age = age;
        }
        say() {
          console.log("hello", this.name);
        }
      }
      const p1 = new Person("zhangsan", 6);
      console.log(p1);
      p1.say();
      class S extends Person {
        constructor(name, age, grade) {
          super(name, age);
          this.grade = grade;
        }
        say() {
          console.log("lisi", this.name);
        }
      }
      const s1 = new S("lisi", 8, "年级");
      console.log(s1);
      s1.say();
    </script>
  </body>
</html>
